package impl

import (
	"gitee.com/yangwencheng/vblog/apps/user"
	"gitee.com/yangwencheng/vblog/config"
	"gitee.com/yangwencheng/vblog/ioc"
	"gorm.io/gorm"
)

// 校验是否实现了接口
var _ user.Service = newImpl()
var _ ioc.CIocObj = newImpl()

func newImpl() *Impl {
	return &Impl{}
}

type Impl struct {
	db *gorm.DB
}

func (impl *Impl) Init() error {
	impl.db = config.C().Mysql.ORM()
	return nil
}

func (impl *Impl) Name() string {
	return user.MODEL_NAME
}

func init() {
	ioc.App().SetController(newImpl())
}
